package com.linkivr.model;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

@Entity
public class T_comport {
	private int id;				//编号
	private String com_name;	//串口名称
	private	int com_id;			//串口号
	private int com_baud;		//波特率
	private	int com_parity;		//校验位  0:N无  1:O奇 2:E偶 3:M标识 4:S空格
	private int com_data;		//数据位  4\5\6\7\8
	private	int com_stop;		//停止位 0:1  1:1.5 2:2
	private	T_app app;			//现场程序编号
	
	@Id
	@GeneratedValue
	public int getId(){
		return id;
	}
	public void setId(int id){
		this.id = id;
	}
	
	public int getCom_id() {
		return com_id;
	}
	public void setCom_id(int comId) {
		com_id = comId;
	}
	public int getCom_baud() {
		return com_baud;
	}
	public void setCom_baud(int comBaud) {
		com_baud = comBaud;
	}
	public int getCom_parity() {
		return com_parity;
	}
	public void setCom_parity(int comParity) {
		com_parity = comParity;
	}
	public int getCom_data() {
		return com_data;
	}
	public void setCom_data(int comData) {
		com_data = comData;
	}
	public int getCom_stop() {
		return com_stop;
	}
	public void setCom_stop(int comStop) {
		com_stop = comStop;
	}
	
	@ManyToOne(fetch=FetchType.EAGER,cascade=CascadeType.ALL)
	@JoinColumn(name = "app_id")
	public T_app getApp() {
		return app;
	}
	public void setApp(T_app app) {
		this.app = app;
	}
	public String getCom_name() {
		return com_name;
	}
	public void setCom_name(String comName) {
		com_name = comName;
	}
}
